//
//  LaunchScrollViewCell.m
//  JWMovie
//
//  Created by Jorn.Wu on 15/7/27.
//  Copyright (c) 2015年 Jorn.Wu. All rights reserved.
//

#import "LaunchScrollViewCell.h"
#import "constant.h"

@interface LaunchScrollViewCell ()

@property (nonatomic, strong) UIImageView *bgImageView;
@property (nonatomic, strong) UIImageView *pageImageView;

@end

@implementation LaunchScrollViewCell

- (instancetype)initWithFrame:(CGRect)frame{
    
    if (self = [super initWithFrame:frame]) {
        
        _bgImageView = [[UIImageView alloc] initWithFrame:self.bounds];
        [self addSubview:_bgImageView];
        
        _pageImageView = [[UIImageView alloc] initWithFrame:CGRectMake((JWScreenWidth - 100) / 2.f, self.frame.size.height - 30, 100, 20)];
        [self addSubview:_pageImageView];
        
        _enterBtn = [[UIButton alloc] initWithFrame:CGRectMake((JWScreenWidth - 250) * 0.5, JWScreenHeight - 150, 250, 40)];
        [_enterBtn setTitleColor:JWColorWithRGB(188, 143, 143, 1) forState:UIControlStateNormal];
        _enterBtn.titleLabel.font = [UIFont systemFontOfSize:25];
        _enterBtn.layer.borderWidth = 2;
        _enterBtn.layer.borderColor = JWColorWithRGB(188, 143, 143, 1).CGColor;
        _enterBtn.layer.cornerRadius = 8.f;
        [self addSubview:_enterBtn];
        
    }
    return self;
}

- (instancetype)setImageWithbgImageName:(NSString *)bgImageName pageImageName:(NSString *)pgImageName{
    _bgImageView.image = [UIImage imageNamed:bgImageName];
    _pageImageView.image = [UIImage imageNamed:pgImageName];
    
    [_enterBtn setTitle:@"开启美好的旅程吧" forState:UIControlStateNormal];
    _enterBtn.hidden = YES;

    return self;
}



/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
